ActionController::Routing::Routes.draw do |map|
  map.resources :orders,:collection=>{:list_items=>:get}
  map.resources :template_styles

  #map.resources :pro_contents

  map.resources :reviews,:collection=>[:list] do |r|
    r.resources :comments
  end
  map.resources :advertisements

  map.resources :styles

  map.resources :navigations

  map.resources :baomings,:except=>[:new,:create]
  map.resources :on_line_baomings,:controller=>:baomings,:only=>[:new,:create],:path_prefix=>"/:tuangou_pro_id"

  map.resources :tuangou_pros,:collection=>[:list]
  
  map.resources :detail,:controller=>:webconfigs,:only=>:show,:path_prefix=>"/:name",:requirements=>{:name=>/\w+/,:id=>/\d*/}
  map.resources :webconfigs,:except=>:show
  
  map.resources :cycles

  map.resources :links
  
  #map.resources :article_contents

  map.resources :article_categories,:as=>"catelogs" do |cate|
    cate.resources :articles,:collection=>[:list]
  end

  map.resources :article_result,:controller=>:articles,:collection=>[:search],:only=>:search

  #map.resources :pro_images

  map.resources :img_types

  #  map.resources :procates do |cate|
  #    cate.resources :pros,:controller=>:products,:collection=>[:list,:result],:only=>[:list,:result]
  #  end
  map.resources :procates ,:shallow=>true do |cate|
    cate.resources :products,:collection=>{:search=>:get,:list=>:get,:result=>[:get,:post]},:member=>{:copy=>:get} do |product|
      product.resources :product_attribute_values
      product.resources :pro_images,:collection=>[:list]
      product.resources :pro_reviews,:collection=>{:list=>:get}
    end
  end

 

  map.resources :users

  map.resource :session

  #map.resources :product_attribute_values

  map.resources :product_attribute_templates

  #map.resources :list_items

  map.resources :lookuplists do |lookuplist|
    lookuplist.resources :list_items
  end

  map.resources :template_categories

  map.resources :data_types

  # The priority is based upon order of creation: first created -> highest priority.

  # Sample of regular route:
  #   map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   map.resources :products

  # Sample resource route with options:
  #   map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }

  # Sample resource route with sub-resources:
  #   map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
  
  # Sample resource route with more complex sub-resources
  #   map.resources :products do |products|
  #     products.resources :comments
  #     products.resources :sales, :collection => { :recent => :get }
  #   end

  # Sample resource route within a namespace:
  #   map.namespace :admin do |admin|
  #     # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
  #     admin.resources :products
  #   end

  # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
  map.root :controller => "display"
  map.admin '/admin',:controller=>"admin",:action=>"index"
  # See how all your routes lay out with "rake routes"

  # Install the default routes as the lowest priority.
  # Note: These default routes make all actions in every controller accessible via GET requests. You should
  # consider removing the them or commenting them out if you're using named routes and resources.
  map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate'
  #map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate', :activation_code => nil
  map.signup '/signup', :controller => 'users', :action => 'new'
  map.login '/login', :controller => 'sessions', :action => 'new'
  map.logout '/logout', :controller => 'sessions', :action => 'destroy'

  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end
